package org.sample.junit4.ex8;

import org.sample.junit4.Calculator;
import org.sample.junit4.Strings;

/**
 * 组装类：通过依赖的 Calculator / Strings 完成复合逻辑。
 */
public class BizFacade {
    private final Calculator calculator;
    private final Strings strings;

    // 构造注入
    BizFacade(Calculator calculator, Strings strings) {
        this.calculator = calculator;
        this.strings = strings;
    }

    // 业务方法：演示组合调用
    String addAndConcat(int a, int b, String s1, String s2) {
        int sum = calculator.add(a, b);
        String merged = strings.concat(s1, s2);
        return sum + ":" + merged;
    }
}
